package com.example.oauth2;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;

import java.util.HashMap;
import java.util.Map;

public class Shuhuantongjiaoben {

    public static void main(String[] args) {
        HashMap<String, Object> stringObjectHashMap = new HashMap<>();
        stringObjectHashMap.put("dataList", "[1,2,\"AASDD\"]");
        Object execute = execute(stringObjectHashMap);
        System.out.println(execute);
    }

    public static <T> T execute(Object params) {
        if (params instanceof Map) {
            Map paramMap = (Map) params;
            String o = (String) paramMap.get("dataList");

            JSONArray objects = JSON.parseArray(o);
            paramMap.put("result", objects);

            //TODO 处理业务逻辑,返回
            return (T) paramMap;
        }
        // TODO
        return null;
    }


}
